/* 销售机会详情页面专用样式 */

/* ==================== 页面布局 ==================== */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    margin-top: 24px;
}

.main-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ==================== 机会概览卡片 ==================== */
.overview-cards {
    margin-bottom: 24px;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.overview-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.overview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.overview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007AFF 0%, #5AC8FA 100%);
}

.level-card::before {
    background: linear-gradient(90deg, #ff3b30 0%, #ff6b6b 100%);
}

.stage-card::before {
    background: linear-gradient(90deg, #30d158 0%, #32d74b 100%);
}

.amount-card::before {
    background: linear-gradient(90deg, #ff9500 0%, #ffcc02 100%);
}

.date-card::before {
    background: linear-gradient(90deg, #5856d6 0%, #af52de 100%);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #ffffff;
}

.card-icon.level-a {
    background: linear-gradient(135deg, #ff3b30 0%, #ff6b6b 100%);
}

.card-icon.stage-5 {
    background: linear-gradient(135deg, #30d158 0%, #32d74b 100%);
}

.card-icon.amount {
    background: linear-gradient(135deg, #ff9500 0%, #ffcc02 100%);
}

.card-icon.date {
    background: linear-gradient(135deg, #5856d6 0%, #af52de 100%);
}

.card-content {
    flex: 1;
}

.card-title {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.card-value {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
    line-height: 1.2;
    margin-bottom: 4px;
}

.card-desc {
    font-size: 12px;
    color: #666;
}

/* ==================== 销售阶段进度 ==================== */
.stage-progress-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

.progress-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.current-stage {
    color: #666;
}

.progress-percent {
    background: #007AFF;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 12px;
}

.stage-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.stage-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #f2f2f7;
}

.timeline-stage {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.stage-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    background: #f2f2f7;
    color: #666;
    position: relative;
    z-index: 1;
}

.timeline-stage.completed .stage-dot {
    background: #30d158;
    color: #ffffff;
}

.timeline-stage.current .stage-dot {
    background: #007AFF;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.timeline-stage.pending .stage-dot {
    background: #f2f2f7;
    color: #8e8e93;
}

.stage-info {
    flex: 1;
}

.stage-title {
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 2px;
}

.timeline-stage.completed .stage-title {
    color: #30d158;
}

.timeline-stage.current .stage-title {
    color: #007AFF;
}

.stage-date {
    font-size: 12px;
    color: #666;
}

/* ==================== 跟进记录 ==================== */
.followup-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.followup-timeline {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
}

.followup-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #f2f2f7;
}

.followup-item {
    display: flex;
    gap: 20px;
    position: relative;
}

.followup-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.time-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #007AFF;
    position: relative;
    z-index: 1;
}

.time-info {
    text-align: center;
    margin-top: 8px;
}

.time-info .date {
    font-size: 12px;
    font-weight: 600;
    color: #1d1d1f;
}

.time-info .time {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.followup-content {
    flex: 1;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    border-left: 3px solid #007AFF;
}

.followup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.followup-title {
    font-weight: 600;
    color: #1d1d1f;
    font-size: 15px;
}

.followup-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #666;
}

.followup-meta .method {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 6px;
    border-radius: 4px;
}

.followup-details {
    margin-bottom: 16px;
}

.followup-details p {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.followup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag.tag-positive {
    background: #e8f5e8;
    color: #2e7d32;
}

.tag.tag-neutral {
    background: #fff3e0;
    color: #ef6c00;
}

.tag.tag-info {
    background: #e3f2fd;
    color: #1565c0;
}

.tag.tag-success {
    background: #e8f5e8;
    color: #2e7d32;
}

.followup-result {
    margin-bottom: 16px;
}

.result-item {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.result-item strong {
    color: #1d1d1f;
}

.followup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.consultant {
    font-size: 12px;
    color: #666;
}

.followup-actions {
    display: flex;
    gap: 4px;
}

.followup-actions .action-btn {
    width: 24px;
    height: 24px;
    font-size: 11px;
}

/* ==================== 决策分析 ==================== */
.decision-analysis-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.analysis-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.analysis-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 16px;
}

.decision-roles {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.role-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e5e5ea;
}

.role-item:last-child {
    border-bottom: none;
}

.role-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.role-name {
    font-size: 14px;
    color: #1d1d1f;
    font-weight: 500;
}

.decision-style {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.style-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.style-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.style-value {
    font-size: 14px;
    color: #1d1d1f;
    font-weight: 500;
}

.factors-grid {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.factor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.factor-name {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.factor-rating {
    display: flex;
    align-items: center;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.rating-stars .fas,
.rating-stars .far {
    color: #ffcc02;
    font-size: 12px;
}

.competition-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.competition-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff3e0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.text-warning {
    color: #ef6c00;
}

.competitor-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.competitor-item {
    font-size: 13px;
    line-height: 1.4;
}

/* ==================== 侧边栏信息卡片 ==================== */
.info-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

.view-link {
    color: #007AFF;
    text-decoration: none;
    font-size: 14px;
}

.view-link:hover {
    text-decoration: underline;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d1d6;
    background: #ffffff;
    color: #666;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: #f2f2f7;
    color: #007AFF;
}

/* 客户信息卡片 */
.customer-info {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.customer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #007AFF;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
}

.customer-details {
    flex: 1;
}

.customer-name {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.customer-phone {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.customer-status {
    display: flex;
    gap: 6px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-active {
    background: #e8f5e8;
    color: #2e7d32;
}

.customer-stats {
    display: grid;
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f2f2f7;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.stat-value {
    font-size: 14px;
    color: #1d1d1f;
    font-weight: 500;
}

.stat-value.health-good {
    color: #30d158;
}

/* 顾问信息卡片 */
.consultant-info {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.consultant-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #30d158;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
}

.consultant-details {
    flex: 1;
}

.consultant-name {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.consultant-role {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.consultant-contact {
    font-size: 13px;
    color: #007AFF;
    display: flex;
    align-items: center;
    gap: 4px;
}

.consultant-stats {
    display: grid;
    gap: 8px;
}

/* 机会信息卡片 */
.opportunity-details {
    display: grid;
    gap: 8px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f2f2f7;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.detail-value {
    font-size: 14px;
    color: #1d1d1f;
    font-weight: 500;
}

/* 下次跟进卡片 */
.next-followup {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.followup-time-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.followup-date {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
}

.followup-time {
    font-size: 14px;
    color: #666;
}

.followup-plan {
    flex: 1;
}

.plan-title {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.plan-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.reminder-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #007AFF;
}

.text-primary {
    color: #007AFF;
}

/* 快捷操作卡片 */
.quick-actions {
    display: grid;
    gap: 8px;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #d1d1d6;
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #1d1d1f;
    text-align: left;
}

.action-button:hover {
    background: #f2f2f7;
    border-color: #007AFF;
}

.action-button.danger {
    color: #ff3b30;
    border-color: #ff3b30;
}

.action-button.danger:hover {
    background: #fff5f5;
}

/* ==================== 添加跟进模态框 ==================== */
.large-modal {
    max-width: 800px;
    width: 90vw;
}

.form-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f2f2f7;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 16px 0;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .content-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar-section {
        order: -1;
    }
    
    .overview-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stage-timeline::before {
        left: 10px;
    }
    
    .stage-dot {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .followup-timeline::before {
        left: 10px;
    }
    
    .time-dot {
        width: 8px;
        height: 8px;
    }
    
    .followup-item {
        gap: 16px;
    }
    
    .followup-time {
        min-width: 50px;
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
    }
    
    .card-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .card-value {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .content-layout {
        gap: 16px;
    }
    
    .info-card {
        padding: 16px;
    }
    
    .stage-progress-section,
    .followup-section,
    .decision-analysis-section {
        padding: 16px;
    }
    
    .customer-info,
    .consultant-info {
        gap: 8px;
    }
    
    .customer-avatar,
    .consultant-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .customer-name,
    .consultant-name {
        font-size: 14px;
    }
    
    .followup-content {
        padding: 12px;
    }
    
    .action-button {
        padding: 10px;
        font-size: 13px;
    }
}